package mapper;

import DO.WorkFillDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WorkFillMapper {
    // 保存填空题信息
    void save(WorkFillDO workFillDO);

    // 根据试卷id获取数据
    @Select("select * from work_fill where work_id = #{workId} order by `order`")
    List<WorkFillDO> getByWorkId(Integer workId);

    @Select("select fill_empty_id from work_fill where work_id = #{workId}")
    List<Integer> getFillIdByWorkId(Integer workId);

    @Select("select count(*) from work_fill where fill_empty_id = #{id}")
    int getIsRelevancyWork(Integer id);
}
